package com.ssy.lingxi.enhance.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 新增加工发货单 - DTO
 * @author fhj
 * @date 2020/11/03
 * @version 2.0.0
 */
@Data
public class AddInvoiceDTO {

    @NotNull(message = "生产通知单ID不能为空")
    @ApiModelProperty(value = "生产通知单ID")
    private Long produceNoticeOrderId;

    @NotNull(message = "对应仓库ID不能为空")
    @ApiModelProperty(value = "对应仓库ID")
    private Long warehouseId;

    @NotBlank(message = "对应仓库人员不能为空")
    @ApiModelProperty(value = "对应仓库人员")
    private String warehouseRole;

    @NotBlank(message = "单据摘要不能为空")
    @ApiModelProperty(value = "单据摘要")
    private String invoiceSummary;

    @NotNull(message = "单据时间不能为空")
    @ApiModelProperty(value = "单据时间")
    private Long invoiceTime;

    @NotNull(message = "请求来源不能为空")
    @ApiModelProperty(value = "请求来源：1.进销存 2.单据")
    private Integer source;

    @Valid
    @NotEmpty(message = "单据明细不能为空")
    @ApiModelProperty(value = "单据明细")
    private List<InvoiceDetailsDTO> invoiceDetailsDTOList;

    @Data
    public static class InvoiceDetailsDTO {

        @ApiModelProperty(value = "货品ID")
        private Long goodsId;

        @ApiModelProperty(value = "货号")
        private String itemNo;

        @ApiModelProperty(value = "货品名称")
        private String itemName;

        @ApiModelProperty(value = "规格")
        private String specifications;

        @ApiModelProperty(value = "型号")
        private String productModel;

        @ApiModelProperty(value = "品类")
        private String category;

        @ApiModelProperty(value = "品牌")
        private String brand;

        @ApiModelProperty(value = "单位")
        private String unit;

        @ApiModelProperty(value = "成本价")
        private Double costPrice;

        @ApiModelProperty(value = "生产通知单明细ID")
        private Long produceNoticeOrderDetailId;

        @ApiModelProperty(value = "商品名称")
        private String productName;

        @ApiModelProperty(value = "商品ID")
        private Long productId;

        @ApiModelProperty(value = "加工数量")
        private Double processNum;

        @ApiModelProperty(value = "订单号")
        private String orderNo;

        @ApiModelProperty(value = "加工单价")
        private Double price;

        @ApiModelProperty(value = "发货数量")
        private Double shipmentQuantity;
    }
}
